import request from '@/utils/request'
// 评论 - 获取列表
export const getCommentsListAPI = ({ artId, offset = null, limit = 10 }) => {
  return request({
    url: '/v1_0/comments',
    // axios的params如果值为null, key+value会忽略
    params: {
      type: 'a',
      source: artId,
      offset,
      limit
    }
  })
}

// 评论 - 点赞
export const likingListAPI = ({ target }) => {
  return request({
    url: '/v1_0/comment/likings',
    method: 'POST',
    data: {
      target
    }
  })
}
// 评论 - 点赞
export const disLikingListAPI = ({ lid }) => {
  return request({
    url: `/v1_0/comment/likings/${lid}`,
    method: 'DELETE'

  })
}
// 评论 - 发布  /v1_0/comments
export const sendCommentAPI = ({ target, content }) => {
  return request({
    url: '/v1_0/comments',
    method: 'POST',
    data: {
      target,
      content
    }
  })
}
